extends "../talin-3/talin-3.gd"


var baseId = ""
var upText1 = "冰血之忆回血量翻倍"
var upText2 = "自毁协议伤害翻倍"
func _extInit():
	._extInit()
	lv = 4             #等级的设置
	addSkill("受到致命伤害时，若存在未死亡的分身，则牺牲该分身，使自己恢复50%血量", "冰血之忆")
		
func onHurtDeath(atkInfo):
	.onHurtDeath(atkInfo)
	var cha = null
	for i in summedCha:
		if i.isDeath:continue
		cha = i
		break

	if atkInfo.hurtChaDead and cha != null:
		atkInfo.hurtChaDead = false
		if upgraded == 2:
			healCha(self, att.maxHp*1)
		else:
			healCha(self, att.maxHp*0.5)
		forceKillCha(cha)
		summedCha.erase(cha)


func upgrade():
	.upgrade()
	if upgraded == 2:
		p3 = 2	